#import "sybase_sup.h"
#import "SUPAnnotations.h"

#import "SUPAbstractEntity.h"
#import "SUPObjectList.h"
#import "SUPLogRecord.h"
#import "SUPMobileBusinessObject.h"
#import "smMboSmMboDB.h"
#import "smMboPersonalizationParameters.h"
#import "smMboSmTbUser.h"
#import "smMboSynchronizationGroup.h"
#import "SUPMBOReplayStream.h"


@class SUPEntityMetaData;

// public interface declaration, can be used by application. 
/*!
 @class smMboSmTbUser_pull_pq
 @abstract This class is part of package "smMbo:1.0"
 @discussion Generated by Sybase Unwired Platform, compiler version 2.1.2.109
*/ 
@interface smMboSmTbUser_pull_pq : SUPAbstractEntity<SUPMobileBusinessObject>
{
@private
    NSString* _username;
    NSString* _remoteId;
    NSString* _empCodeParam;
    NSString* _empPsdParam;
    int64_t _id;
}

@property(retain,nonatomic) NSString* username;
@property(retain,nonatomic) NSString* remoteId;
@property(retain,nonatomic) NSString* empCodeParam;
@property(retain,nonatomic) NSString* empPsdParam;
@property(assign,nonatomic) int64_t id_;

- (void)dealloc;
/*!
  @method 
  @abstract Sets relationship attributes to null to save memory (they will be retrieved from the DB on the next getter call or property reference)
  @discussion
  @throws SUPPersistenceException
 */
- (void)clearRelationshipObjects;
/*!
  @method 
  @abstract Create this entity row in the database
  @discussion
  @throws SUPPersistenceException
 */
- (void)create;
/*!
  @method 
  @abstract Update this entity row in the database
  @discussion
  @throws SUPPersistenceException
 */
- (void)update;
/*!
  @method 
  @abstract Delete this entity row from the database
  @discussion
  @throws SUPPersistenceException
 */
- (void)delete;
/*!
  @method 
  @abstract Copy all attributes (except relationships) from 'other' to this entity
  @discussion
 */
- (void)copyAll:(smMboSmTbUser_pull_pq*)other;
/*!
  @method 
  @abstract Returns the entity for the primary key value passed in, or null if the entity is not found.
  @discussion
  @throws SUPPersistenceException
 */
+ (smMboSmTbUser_pull_pq*)find:(int64_t)id;
/*!
  @method 
  @abstract Same as the find method above, but takes a string representation of the primary key as its parameter.
  @discussion
  @throws SUPPersistenceException
 */
+ (smMboSmTbUser_pull_pq*)find_by_id_string:(NSString*)id_string;
/*!
  @method 
  @abstract Return the synchronization group for this MBO class
  @discussion
 */
+ (id<SUPSynchronizationGroup>)getSynchronizationGroup;
/*!
  @method 
  @abstract Returns the primary key for this entity.
  @discussion
 */
- (int64_t)_pk;
- (int64_t)id;
/*!
  @method 
  @abstract Returns the primary key for this entity as a string.
  @discussion
 */
- (NSString*)keyToString;
/*!
  @method 
  @abstract Returns the entity for the primary key value passed in; throws an exception if the entity is not found.
  @discussion
  @throws SUPPersistenceException
 */
+ (smMboSmTbUser_pull_pq*)load:(int64_t)id;

/*!
  @method 
  @abstract Creates a new autoreleased instance of this class
  @discussion
 */
+ (smMboSmTbUser_pull_pq*)getInstance;
/*!
  @method 
  @abstract Returns an SUPObjectList of log records for this entity.
  @discussion
  @throws SUPPersistenceException
 */
- (SUPObjectList*)getLogRecords;
/*!
  @method 
  @abstract Creates a new log record for this entity.
  @discussion
  @throws SUPPersistenceException
 */
- (id<SUPLogRecord>)createLogRecord:(int32_t)level withMessage:(NSString*)message;
/*!
  @method 
  @abstract Saves (creates or updates) this entity in the database.
  @discussion
  @throws SUPPersistenceException
 */
- (void)save;
/*!
  @method 
  @abstract Return a string description of this entity.
  @discussion
 */
- (NSString*)toString;
/*!
  @method 
  @abstract Return a string description of this entity.
  @discussion
 */
- (NSString*)description;
/*!
  @method 
  @abstract If this entity has pending changes, submits those changes to the server.
  @discussion
  @throws SUPPersistenceException
 */
- (void)submitPending;
/*!
  @method
  @abstract Generated from an object query defined in the Eclipse tooling project for this package
  @throws SUPPersistenceException
 */

+ (SUPObjectList*)findAll;

/*!
  @method
  @abstract Generated from an object query defined in the Eclipse tooling project for this package
  @param skip
  @param take
  @throws SUPPersistenceException
 */

+ (SUPObjectList*)findAll:(int32_t)skip take:(int32_t)take;
/*!
  @method
  @abstract Generated from an object query defined in the Eclipse tooling project for this package
  @param _username
  @param empCode
  @param empPsd
  @throws SUPPersistenceException
 */

+ (smMboSmTbUser_pull_pq*)findSub:(NSString*)_username withEmpCode:(NSString*)empCode withEmpPsd:(NSString*)empPsd;
/*!
  @method
  @abstract Generated from an object query defined in the Eclipse tooling project for this package
  @throws SUPPersistenceException
 */

+ (SUPObjectList*)getPendingObjects;

/*!
  @method
  @abstract Generated from an object query defined in the Eclipse tooling project for this package
  @param skip
  @param take
  @throws SUPPersistenceException
 */

+ (SUPObjectList*)getPendingObjects:(int32_t)skip take:(int32_t)take;
/*!
  @method
  @abstract Generated from an object query defined in the Eclipse tooling project for this package
  @param pendingChange
  @throws SUPPersistenceException
 */

+ (SUPObjectList*)getPendingObjects:(unichar)pendingChange;

/*!
  @method
  @abstract Generated from an object query defined in the Eclipse tooling project for this package
  @param pendingChange
  @param skip
  @param take
  @throws SUPPersistenceException
 */

+ (SUPObjectList*)getPendingObjects:(unichar)pendingChange skip:(int32_t)skip take:(int32_t)take;
/*!
  @method
  @abstract Generated from an object query defined in the Eclipse tooling project for this package
  @throws SUPPersistenceException
 */

+ (SUPObjectList*)getReplayPendingObjects;

/*!
  @method
  @abstract Generated from an object query defined in the Eclipse tooling project for this package
  @param skip
  @param take
  @throws SUPPersistenceException
 */

+ (SUPObjectList*)getReplayPendingObjects:(int32_t)skip take:(int32_t)take;
/*!
  @method
  @abstract Generated from an object query defined in the Eclipse tooling project for this package
  @throws SUPPersistenceException
 */

+ (int32_t)countReplayPendingObjects;


@end

typedef SUPObjectList smMboSmTbUser_pull_pqList;

// internal methods declaration, only used by generated code.
@interface smMboSmTbUser_pull_pq(internal)


- (id)initFromJson:(SUPJsonObject*)json:(int32_t)flags;
- (void)readJson:(SUPJsonObject*)json:(int32_t)flags;
- (SUPJsonObject*)json:(int32_t)flags;
- (SUPJsonObject*)json:(int32_t)flags:(BOOL)streaming;
+ (SUPObjectList*)fromJSONList:(SUPJsonArray*)jsonArray NS_RETURNS_RETAINED;
+ (SUPJsonArray*)toJSONList:(SUPObjectList*)instanceList;


- (smMboSmMboDB*)database;
- (SUPAbstractEntity*)topLevelParent;
- (void)submitPendingNoRefresh;
- (void)submitPending1:(BOOL)doRefresh;
- (void)cancelReplayPending:(SUPAbstractEntity*)entity;
- (void)cancelPending_OnlyReplayPending:(BOOL)replayPendingOnly:(SUPAbstractEntity*)entity;
- (long)getRowId:(BOOL)isPending;

+ (NSMutableDictionary*)attr_map;

- (void)writeToMBOReplayStream:(SUPMBOReplayStream*)stream;
@end